From 605b7a945d35726d195ac668acacd65fd491cdde Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 21 Nov 2003 16:34:57 +0000 Subject: [PATCH] bitkeeper revision 1.626 (3fbe3eb1WmztnxBIFxm56r8gAVwZig) Many files: Some fixes. Also now have a new Makefile target 'dist' which installs stuff to local install directory. Target 'install' now actually does what you expect by installing under /usr xi_stopdom.py: Rename: tools/misc/xi_stopdom.py -> tools/examples/xi_stopdom.py xi_listdoms.py: Rename: tools/misc/xi_listdoms.py -> tools/examples/xi_listdoms.py xi_destroydom.py: Rename: tools/misc/xi_destroydom.py -> tools/examples/xi_destroydom.py xi_createlinuxdom.py: Rename: tools/misc/xi_createlinuxdom.py -> tools/examples/xi_createlinuxdom.py --- .rootkeys | 8 ++--- Makefile | 16 +++------ docs/Xeno-HOWTO | 34 +++++++++++-------- tools/Makefile | 5 +++ tools/balloon/Makefile | 4 +++ tools/{misc => examples}/xi_createlinuxdom.py | 8 ++--- tools/{misc => examples}/xi_destroydom.py | 2 +- tools/{misc => examples}/xi_listdoms.py | 2 +- tools/{misc => examples}/xi_stopdom.py | 2 +- tools/misc/Makefile | 16 +++++---- tools/misc/miniterm/Makefile | 3 ++ tools/misc/xen-clone | 4 +-- tools/xc/Makefile | 6 +++- tools/xc/lib/Makefile | 8 +++++ tools/xc/py/Makefile | 8 ++++- xen/Makefile | 5 +++ xen/include/xeno/event.h | 2 +- xenolinux-2.4.22-sparse/arch/xeno/Makefile | 4 +++ 18 files changed, 89 insertions(+), 48 deletions(-) rename tools/{misc => examples}/xi_createlinuxdom.py (92%) rename tools/{misc => examples}/xi_destroydom.py (93%) rename tools/{misc => examples}/xi_listdoms.py (80%) rename tools/{misc => examples}/xi_stopdom.py (89%) diff --git a/.rootkeys b/.rootkeys index a30c685011..7d2f1e61b0 100644 --- a/.rootkeys +++ b/.rootkeys @@ -39,6 +39,10 @@ 3e6377b24eQqYMsDi9XrFkIgTzZ47A tools/balloon/Makefile 3e6377d6eiFjF1hHIS6JEIOFk62xSA tools/balloon/README 3e6377dbGcgnisKw16DPCaND7oGO3Q tools/balloon/balloon.c +3fbe2f12OPAkzIUtumU3wRAihnhocQ tools/examples/xi_createlinuxdom.py +3fbe2f12dZbmXLlgQdMgkmnSUj23AQ tools/examples/xi_destroydom.py +3fbe2f12ltvweb13kBSsxqzZDAq4sg tools/examples/xi_listdoms.py +3fbe2f12Bnt8mwmr1ZCP6HWGS6yvYw tools/examples/xi_stopdom.py 3f776bd2Xd-dUcPKlPN2vG89VGtfvQ tools/misc/Makefile 3f6dc136ZKOjd8PIqLbFBl_v-rnkGg tools/misc/miniterm/Makefile 3f6dc140C8tAeBfroAF24VrmCS4v_w tools/misc/miniterm/README @@ -53,10 +57,6 @@ 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c -3fbe2f12OPAkzIUtumU3wRAihnhocQ tools/misc/xi_createlinuxdom.py -3fbe2f12dZbmXLlgQdMgkmnSUj23AQ tools/misc/xi_destroydom.py -3fbe2f12ltvweb13kBSsxqzZDAq4sg tools/misc/xi_listdoms.py -3fbe2f12Bnt8mwmr1ZCP6HWGS6yvYw tools/misc/xi_stopdom.py 3fbca441SjQr8vJwTQIgH1laysaWog tools/xc/Makefile 3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/xc/lib/Makefile 3fbba6dbEVkVMX0JuDFzap9jeaucGA tools/xc/lib/libxc_bvtsched.c diff --git a/Makefile b/Makefile index 2196692122..e429b6b1bf 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,11 @@ -# + # Grand Unified Makefile for Xen. # -# Keir Fraser, 6/5/2003 -# # Builds everything except Xenolinux: # cd xenolinux--sparse # ./mkbuildtree # cd && make oldconfig && make dep && make bzImage # ( should be a vanilla linux tree with matching version) -# -# If you get errors in tools/domctl or tools/vdmanager, then you need -# the latest Java 2 SDK on your execution path: -# Also, you will need Apache's 'ant' build tool: -# -# If you received this source as part of a Xen release, you should find -# that appropriate versions of the build tools are already installed in -# the initial system setup. all: $(MAKE) -C xen @@ -25,6 +15,10 @@ install: all $(MAKE) -C xen install $(MAKE) -C tools install +dist: all + $(MAKE) -C xen dist + $(MAKE) -C tools dist + clean: $(MAKE) -C xen clean $(MAKE) -C tools clean diff --git a/docs/Xeno-HOWTO b/docs/Xeno-HOWTO index bfa3610927..ef25ea7644 100644 --- a/docs/Xeno-HOWTO +++ b/docs/Xeno-HOWTO @@ -17,16 +17,15 @@ To fetch a local copy, first download the BitKeeper tools at: http://www.bitmover.com/download with username 'bitkeeper' and password 'get bitkeeper'. -Then install it and run: -# cd / +Then install the tools and then run: # bk clone bk://xen.bkbits.net/xeno-1.1.bk Under your current directory, a new directory named 'xeno-1.1.bk' has been created, which contains all the source codes for Xen and -XenoLinux. Here we suppose you put it under '/'. +XenoLinux. To get newest changes to the repository, run -# cd /xeno-1.1.bk +# cd xeno-1.1.bk # bk pull @@ -39,7 +38,7 @@ used to clone the repostitory and perform a full build. To build Xen manually: -# cd /xeno-1.1.bk/xen +# cd xeno-1.1.bk/xen # make clean # make @@ -47,8 +46,13 @@ This will (should) produce a file called 'image' in the current directory. This is the ELF 32-bit LSB executable file of Xen. You can also find a gzip version, named 'image.gz'. -Hint: There is a 'make install' rule which also and then copies it to -../../install ; if this suits your setup, go for it. +To install the built files on your Xenoserver under /usr, type 'make +install' at the root of the BK repository. You will need to be root to +do this! + +Hint: There is also a 'make dist' rule which copies built files to an +install directory just outside the BK repo; if this suits your setup, +go for it. Build XenoLinux @@ -111,9 +115,11 @@ have zlib and devlopment headers installed. Also you will need at least Python v2.2. 'make install' in the tools directory will place executables and -libraries in an install directory immediately outside you local -repository. NOTE: the installation of the Python modules may need root -privileges if you are not using a personal installation of Python. +libraries in /usr/bin and /usr/lib. You will need to be root to do this! + +As noted earlier, 'make dist' installs files to a local 'install' +directory just outside the BK repository. These files will then need +to be installed manually onto the Xenoserver. Installation @@ -204,7 +210,7 @@ UDP packets to the local virtual network. Those packets are received by xen_read_console running in Domain 0 and output are printed out to the standard output. -Now edit the installed xi_createlinuxdom.py script to your taste. This +Now edit the tools/examples/xi_createlinuxdom.py script to your taste. This should then be executed as root to create a new domain. You should be able to see XenoLinux boot message on standard output @@ -215,14 +221,14 @@ List and Stop Domains ============================== You can see a list of existing domains with: -# xi_listdoms.py +# tools/examples/xi_listdoms.py In order to stop a domain, you use: -# xi_stopdom.py +# tools/examples/xi_stopdom.py To destroy a domain use ('force' causes an immediate destruction without waiting for the guest OS to shut down cleanly): -# xi_destroydom.py [force] +# tools/examples/xi_destroydom.py [force] Other Control Tasks using Python diff --git a/tools/Makefile b/tools/Makefile index 18994da98d..96913d7424 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -27,6 +27,11 @@ install: all $(MAKE) -C xc install $(MAKE) -C misc install +dist: all + $(MAKE) -C balloon dist + $(MAKE) -C xc dist + $(MAKE) -C misc dist + clean: $(MAKE) -C balloon clean $(MAKE) -C xc clean diff --git a/tools/balloon/Makefile b/tools/balloon/Makefile index 86108af671..9c08018cef 100644 --- a/tools/balloon/Makefile +++ b/tools/balloon/Makefile @@ -5,6 +5,10 @@ $(TARGET): balloon.c $(CC) -O2 -Wall -o $(TARGET) balloon.c install: $(TARGET) + mkdir -p /usr/bin + cp -a $(TARGET) /usr/bin + +dist: $(TARGET) mkdir -p ../../../install/bin cp -a $(TARGET) ../../../install/bin diff --git a/tools/misc/xi_createlinuxdom.py b/tools/examples/xi_createlinuxdom.py similarity index 92% rename from tools/misc/xi_createlinuxdom.py rename to tools/examples/xi_createlinuxdom.py index 1695a0e8cb..2e25e303e8 100755 --- a/tools/misc/xi_createlinuxdom.py +++ b/tools/examples/xi_createlinuxdom.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # Example script for creating and building a new Linux guest OS for Xen. @@ -17,15 +17,15 @@ ipaddr = "ADDRESS" netmask = XenoUtil.get_current_ipmask() gateway = XenoUtil.get_current_ipgw() -# STEP 3. Specify NFS server and path to rootfs (only needed for network boot) +# STEP 3a. Specify NFS server and path to rootfs (only needed for network boot) nfsserv = "ADDRESS" nfspath = "FULL_PATH_TO_ROOT_DIR" -# STEP 4. Specify root (and possibly /usr) on local disc (if not NFS booting) +# STEP 3b. Specify root (and possibly /usr) on local disc (if not NFS booting) #root_partn = "/dev/sda2" #usr_partn = "/dev/sda6" -# STEP 5. Check that the following cmdline setup is to your taste. +# STEP 4. Check that the following cmdline setup is to your taste. cmdline = "ip="+ipaddr+":"+nfsserv+":"+gateway+":"+netmask+"::eth0:off" if root_partn: # Boot from local disc. May specify a separate /usr. diff --git a/tools/misc/xi_destroydom.py b/tools/examples/xi_destroydom.py similarity index 93% rename from tools/misc/xi_destroydom.py rename to tools/examples/xi_destroydom.py index c5f3f99024..0c3c0d164b 100644 --- a/tools/misc/xi_destroydom.py +++ b/tools/examples/xi_destroydom.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # Destroy specified domain. diff --git a/tools/misc/xi_listdoms.py b/tools/examples/xi_listdoms.py similarity index 80% rename from tools/misc/xi_listdoms.py rename to tools/examples/xi_listdoms.py index 401602ec02..0bc3d9b848 100644 --- a/tools/misc/xi_listdoms.py +++ b/tools/examples/xi_listdoms.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # List info on all domains. diff --git a/tools/misc/xi_stopdom.py b/tools/examples/xi_stopdom.py similarity index 89% rename from tools/misc/xi_stopdom.py rename to tools/examples/xi_stopdom.py index 699c9c0727..aa20a97ac0 100644 --- a/tools/misc/xi_stopdom.py +++ b/tools/examples/xi_stopdom.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # Stop execution of specified domain. diff --git a/tools/misc/Makefile b/tools/misc/Makefile index d721978783..19d25b4748 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -10,23 +10,25 @@ OBJS = $(patsubst %.c,%.o,$(SRCS)) TARGETS = xen_read_console xen_refresh_dev xen_cpuperf INSTALL = $(TARGETS) xen-mkdevnodes xen_nat_enable xen-clone -INSTALL += xi_createlinuxdom.py xi_destroydom.py xi_listdoms.py -INSTALL += xi_stopdom.py all: $(TARGETS) $(MAKE) -C miniterm install: all + mkdir -p /usr/bin + cp -a $(INSTALL) /usr/bin + chmod 755 /usr/bin/xen-mkdevnodes + chmod 755 /usr/bin/xen_nat_enable + chmod 755 /usr/bin/xen-clone + $(MAKE) -C miniterm install + +dist: all mkdir -p ../../../install/bin cp -a $(INSTALL) ../../../install/bin chmod 755 ../../../install/bin/xen-mkdevnodes chmod 755 ../../../install/bin/xen_nat_enable chmod 755 ../../../install/bin/xen-clone - chmod 755 ../../../install/bin/xi_createlinuxdom.py - chmod 755 ../../../install/bin/xi_destroydom.py - chmod 755 ../../../install/bin/xi_listdoms.py - chmod 755 ../../../install/bin/xi_stopdom.py - $(MAKE) -C miniterm install + $(MAKE) -C miniterm dist clean: $(RM) *.o $(TARGETS) diff --git a/tools/misc/miniterm/Makefile b/tools/misc/miniterm/Makefile index 59fd0a17bf..4a3656fd25 100644 --- a/tools/misc/miniterm/Makefile +++ b/tools/misc/miniterm/Makefile @@ -4,6 +4,9 @@ CFLAGS = -O3 -march=i686 -Wall all: miniterm install: all + cp -a miniterm /usr/bin/ + +dist: all cp -a miniterm ../../../../install/bin/ clean: diff --git a/tools/misc/xen-clone b/tools/misc/xen-clone index 06aba1d815..30fa57baa4 100755 --- a/tools/misc/xen-clone +++ b/tools/misc/xen-clone @@ -76,7 +76,7 @@ fi # build and install Xen and tools cd ${DEST_BK_REP} -make install +make dist || make install # Turn linux into xenolinux then build it cd xenolinux-${LINUX_VER}-sparse @@ -89,7 +89,7 @@ export INSTALL_MOD_PATH=${TOP}/install make oldconfig make dep make bzImage -make install +make dist || make install make modules make modules_install cd .. diff --git a/tools/xc/Makefile b/tools/xc/Makefile index 29843adf14..0855485fd3 100644 --- a/tools/xc/Makefile +++ b/tools/xc/Makefile @@ -3,10 +3,14 @@ all: $(MAKE) -C lib $(MAKE) -C py -install: +install: all $(MAKE) -C lib install $(MAKE) -C py install +dist: all + $(MAKE) -C lib dist + $(MAKE) -C py dist + clean: $(MAKE) -C lib clean $(MAKE) -C py clean diff --git a/tools/xc/lib/Makefile b/tools/xc/lib/Makefile index 24858d793a..3e8e17c65a 100644 --- a/tools/xc/lib/Makefile +++ b/tools/xc/lib/Makefile @@ -20,6 +20,14 @@ check-for-zlib: fi install: all + mkdir -p /usr/lib + mkdir -p /usr/include + cp -a $(LIBS) /usr/lib + for i in $(LIBS); do chmod 755 /usr/bin/$i ; done + cp -a xc.h /usr/include + chmod 644 /usr/include/xc.h + +dist: all mkdir -p ../../../../install/lib mkdir -p ../../../../install/include cp -a $(LIBS) ../../../../install/lib diff --git a/tools/xc/py/Makefile b/tools/xc/py/Makefile index a402cf77b6..a3488237fc 100644 --- a/tools/xc/py/Makefile +++ b/tools/xc/py/Makefile @@ -2,8 +2,14 @@ all: ../lib/libxc.a python setup.py build -install: +install: all python setup.py install +dist: all + mkdir -p ../../../../install/lib/python + for i in `find . -name 'Xc.so'` ; do \ + cp $$i ../../../../install/lib/python/`basename $$i` ; \ + done + clean: rm -rf build *.pyc *.pyo *.o *.a *~ diff --git a/xen/Makefile b/xen/Makefile index 742cf4561a..be24c07e0f 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -18,6 +18,11 @@ debug: objdump -D -S $(TARGET) > $(TARGET).s install: $(TARGET) + gzip -f -9 < $(TARGET) > $(TARGET).gz + mkdir -p /boot + cp -a $(TARGET).gz /boot + +dist: $(TARGET) gzip -f -9 < $(TARGET) > $(TARGET).gz mkdir -p ../../install/boot cp -a $(TARGET).gz ../../install/boot/ diff --git a/xen/include/xeno/event.h b/xen/include/xeno/event.h index c733dc46fb..6627afdf64 100644 --- a/xen/include/xeno/event.h +++ b/xen/include/xeno/event.h @@ -47,7 +47,7 @@ static inline unsigned long mark_guest_event(struct task_struct *p, int event) /* As above, but hyp_events are handled within the hypervisor. */ static inline unsigned long mark_hyp_event(struct task_struct *p, int event) { - if ( test_and_set_bit(event, &p->shared_info->events) ) + if ( test_and_set_bit(event, &p->hyp_events) ) return 0; smp_mb(); if ( p->state == TASK_INTERRUPTIBLE ) wake_up(p); diff --git a/xenolinux-2.4.22-sparse/arch/xeno/Makefile b/xenolinux-2.4.22-sparse/arch/xeno/Makefile index 51a20235d2..815c28107b 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/Makefile +++ b/xenolinux-2.4.22-sparse/arch/xeno/Makefile @@ -96,6 +96,10 @@ bzImage: vmlinux @$(MAKEBOOT) xenolinux.gz install: bzImage + mkdir -p /boot + cp -a arch/$(ARCH)/boot/xenolinux.gz /boot/xenolinux.gz + +dist: bzImage mkdir -p ../install/boot cp -a arch/$(ARCH)/boot/xenolinux.gz ../install/boot/xenolinux.gz -- 2.30.2